import PayManagement from "../pages/PayManagement"
import PayWays from "../pages/PayManagement/PayWays"

import PictureManagement from "../pages/PictureManagement"
import CarouselManagement from "../pages/PictureManagement/CarouselManagement"

import  ProductManagement from "../pages/ProductManagement"
import ProductList from "../pages/ProductManagement/ProductList"
import ProductType from "../pages/ProductManagement/ProductType"

import TransactionManagement from "../pages/TransactionManagement"
import Amount from "../pages/TransactionManagement/Amount"
import Order from "../pages/TransactionManagement/Order"
import Refund from "../pages/TransactionManagement/Refund"

import Welcome from "../pages/Welcome"
 import Login from "pages/Login"
 import Page404 from "../pages/Page404"
// import { Carousel } from "antd"

 //auth这个属性用于控制页面是否需要登入才能访问
 //一级路径的exact不能是true 不然无法访问匹配的嵌套路由
 const routes=[
     {
         path:"/404",
         component:Page404,
         auth:false
     }, 
     {
         path:"/",
         component:Welcome,
         auth:true,
         exact:true,
         meta:{
             name:"首页" , //标记菜单名字
             icon:'icon-shouye'
         }
     },
     {
        path:"/login",
        component:Login,
        auth:false,
        exact:true,
        meta:{
            name:"登入"
        }
    },
    {
        path:"/product-management",
        component:ProductManagement,
        auth:true,
        exact:false,
        meta:{
            name:"商品管理",
            icon:'icon-shangpinguanli'
        },
        children:[
            {
                path:"/product-management/productlist",
                component:ProductList,
                auth:true,
                exact:true,
                meta:{
                    name:"商品列表",
                    icon:'icon-liebiao1'
                }
            },
            {
                path:"/product-management/producttype",
                component:ProductType,
                auth:true,
                exact:true,
                meta:{
                    name:"商品类目",
                    icon:'icon-boniaosuan'
                }
            }
        ]
    },
    {
        path:"/transaction-management",
        component:TransactionManagement,
        auth:true,
        exact:false,
        meta:{
            name:"交易管理",
            icon:'icon-jiaoyi'
        },
        children:[
            {
                path:"/transaction-management/amount",
                component:Amount,
                auth:true,
                exact:true,
                meta:{
                    name:"交易金额",
                    icon:'icon-jine'
                },
            },
            {
                path:"/transaction-management/order",
                component:Order,
                auth:true,
                exact:true,
                meta:{
                    name:"交易订单",
                    icon:'icon-jine'
                },
            },
            {
                path:"/transaction-management/refund",
                component:Refund,
                auth:true,
                exact:true,
                meta:{
                    name:"退款",
                    icon:'icon-tuikuane'

                },
            }
        ]
    },
    {
        path:"/picture-management",
        component:PictureManagement,
        auth:true,
        exact:false,
        meta:{
            name:"图片管理",
            icon:'icon-tubiaozhizuomobanyihuifu-'
        },
        children:[
            {
                path:"/picture-management/carousel-management",
                component:CarouselManagement,
                auth:true,
                exact:true,
                meta:{
                    name:"轮播图管理",
                    icon:'icon-lunbotu'
                },
            }
        ]
    },
    
     {
        path:"/pay-management",
        component:PayManagement,
        auth:true,
        exact:false,
        meta:{
            name:"支付管理",
            icon:'icon-zhifubao1'
        },
        children:[
            {
                path:"/pay-management/pay-ways",
                component:PayWays,
                auth:true,
                exact:true,
                meta:{
                    name:"支付方式",
                    icon:'icon-zhifumoban'
                },
                // children:[
                //     {
                //         path:"/pay-management/pay-ways",
                //         component:PayWays,
                //         auth:true,
                //         exact:true,
                //         meta:{
                //             name:"支付3"
                //         },
                //     }
                // ]
            }
        ]
    },
    
   
 ]

 export default routes